package com.tensquare.rabbit;

/**
 * Created by duizhang on 2018/12/15.
 */


public enum Enum {
    RED("红色", "1"),
    GREEN("绿色", "2"),
    BLANK("白色", "3"),
    YELLO("黄色", "4");
    // 成员变量
    private String name;
    private String index;

    private Enum(String name, String index) {
        this.name = name;
        this.index = index;
    }
    public static String getName(String index){
        for (Enum c:Enum.values()){
            if (c.getIndex() == index){
                return c.name;
            }
        }
        return null;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getIndex() {
        return index;
    }

    public void setIndex(String index) {
        this.index = index;
    }
}
